package com.qiuyang.service.show.Impl;

import com.qiuyang.mapper.show.ShowCommentMapper;
import com.qiuyang.pojo.Comment;
import com.qiuyang.service.show.ShowCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ShowCommentServiceImpl implements ShowCommentService {

    @Autowired
    private ShowCommentMapper showCommentMapper;

    @Override
    public void inserComment(Comment comment) {
        comment.setCreateTime(new Date());
        showCommentMapper.inserComment(comment);
    }

    @Override
    public List<Comment> findCommentByBid(Long blogId) {
        return showCommentMapper.findCommentByBid(blogId);
    }

    @Override
    public Comment findComment(long id) {
        return showCommentMapper.findComment(id);
    }
}
